var myChart = echarts.init(document.getElementById('main'));
var myChart2 = echarts.init(document.getElementById('right'));
var option = {
    title: {
        text: '2018年注册人数'
    },
    tooltip: {},
    legend: {
        data:['人数']
    },
    xAxis: {
        data: ["1月","2月","3月","4月","4月","5月"]
    },
    yAxis: {},
    series: [{
        name: '人数',
        type: 'bar',
        data: [1000, 1500, 1800, 1200, 1000, 500]
    }]
};

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);

    option2 = {
        title : {
            text: '2018年热门销售',
            subtext: '2018年12月',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['阿迪达斯','耐克','李宁','安踏','鸿星尔克']
        },
        series : [
            {
                name: '访问来源',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:335, name:'阿迪达斯'},
                    {value:310, name:'耐克'},
                    {value:234, name:'李宁'},
                    {value:135, name:'安踏'},
                    {value:1548, name:'鸿星尔克'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(248, 250, 13,1)'
                    }
                }
            }
        ]
    };
    myChart2.setOption(option2);
